package random;

import java.util.List;

public final class ArrayMap {
	
	private final int size;
	private final List<int[]>[][] arr;
	
	public ArrayMap(int size){
		this.size = size;
		arr = new List[this.size][];
	}

	public final void put(int[] key, List<int[]> value) {
		final int x = key[0];
		final int y = key[1];
		List<int[]>[] a;
		if ((a = arr[x]) == null) {
			a = arr[x] = new List[this.size];
		}
		a[y] = value;
		return;
	}

	public final List<int[]> get(int[] key) {
		final int x = key[0];
		final int y = key[1];
		final List<int[]>[] a;
		if ((a = arr[x]) == null) {
			return null;
		}
		return a[y];
	}

}
